package com.zwj.enums;

/**
 * 用户类型枚举
 */
public enum RoleTypeEnum {
    // 数据操作错误定义
    STUDENT("0", "学生"),
    TEACHER("1","教师"),
    ADMIN("2","管理员");
    private String key;
    private String value;
    RoleTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }
    public static String getEnumValue(String key) {
        RoleTypeEnum[] roleTypeEnums = RoleTypeEnum.values();
        for (RoleTypeEnum roleTypeEnum : roleTypeEnums) {
            if (roleTypeEnum.getKey().equals(key)) {
                return roleTypeEnum.getValue();
            }
        }
        return null;
    }


    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
